#!/bin/bash

# case word in
#   pattern1)
#   语句代码块
#   ;;
#   *)
#   默认输出代码块
#   ;;
# esac


# read -p  "请用户输入数字(1-5):" num

# case $num in
#     1)
#         echo "hello" 
#     ;;
#     2)
#         echo "world"
#     ;;
#     3)
#         echo  "good"
#     ;;
#     4)
#         echo  "bf"
#     ;;
#     5)
#         echo  "gun"
#     ;;
#     *)
#         echo  "退出"
#     ;;
# esac


echo "=============meun================"
echo  "查看磁盘 df"
echo  "查看IP地址 ip"
echo  "输出5表示退出"
echo "================================="

read -p  "请用户输入需要执行的命令:" command


case $command in
    df)
        clear
        df -h  
    ;;
    free)
        free -h
    ;;
    ip)
        ip add | grep  inet
    ;;
    ss)
        ss -luntp
    ;;
    5)
        exit 1
    ;;
    *)
        echo  "输入错误，请重新输入"
    ;;
esac